package com.learn;

import java.time.LocalDateTime;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * 此监听器可以监听应用的启动和停止
 * @author Romanceling
 *
 */
@WebListener
public class MyContextListener implements ServletContextListener {

	@Override
	public void contextInitialized(ServletContextEvent sce) {
		System.out.println("app started at "+ LocalDateTime.now().toLocalDate());
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {

	}

}
